package com.example.demo.ip;

import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.security.KeyPair;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.util.HashMap;
import java.util.Map;

public class IPTest {

    public static void main(String[] args) throws UnknownHostException {
        InetAddress localHost = InetAddress.getLocalHost();
        System.out.println(localHost);


        InetAddress localHost1 = Inet4Address.getLocalHost();
        System.out.println(localHost);

        InetAddress localHost3 = Inet6Address.getLocalHost();
        System.out.println(localHost.getHostAddress());

        InetAddress loopbackAddress = Inet6Address.getLoopbackAddress();
        System.out.println(loopbackAddress);

        Inet6Address.getLoopbackAddress();
    }





}
